package com.kaili.basic.controller.web.v1;

import com.baomidou.mybatisplus.plugins.Page;
import com.kaili.basic.pojo.dto.BaseLogQueryDto;
import com.kaili.basic.pojo.entity.BaseLog;
import com.kaili.basic.service.BaseLogService;
import com.kaili.basic.version.ApiVersion;
import com.kaili.common.response.CommonStatus;
import com.kaili.common.response.RestStatus;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@ApiVersion(1)
@RequestMapping("/{api_version}")
@RestController
@Api(tags = "日志管理", description = "日志管理相关API")
public class BaseLogController {
    @Autowired
    private BaseLogService baseLogService;

    @GetMapping("/logs")
    @ApiOperation(value = "分页查询日志", notes = "分页查询事件")
    public Page<BaseLog> queryBaseLog(@ModelAttribute BaseLogQueryDto dto) {
        return baseLogService.queryLogByEwbNo(new Page<BaseLog>(dto.getPage(), dto.getPageSize()), dto);
    }
}
